/**
 * Created by Jaye on 2017/12/25.
 */

function login() {
    // var accesspoint_username = $.trim($('#accesspoint_username').val());
    // var accesspoint_nickname = $.trim($('#accesspoint_nickname').val());
    var form_data = $('#login_form').serialize();
    $.ajax(
        {
            url: "/dologin",
            data: form_data,
            type: "post",
            dataType: "json",
            success: function (data) {
                if (data.code == 1000) {
                    // if (data.data.executeResult) {
                    //     alert("新增成功！");
                    //     location.reload();
                    //     return;
                    // }
                    window.location.href="/index";
                    return
                }else {
                    $("#tip").html("<span style='color:red'>用户名或密码错误，请重试</span>");
                }
            },
            error: function () {
                alert('请求出错');
            }
        });
}
